from drg_group.yinchuan_2023.Base import message,intersect,SS_VALID
from drg_group.yinchuan_2023.DRG import MDCI_DRG

def group(record):
  adrg_zd=["C40.002","C40.200x005","C40.201","C40.202","C41.100x002","C41.203","C41.301","C41.302","C41.400x009","C41.402","C41.403","C41.404","C41.406","C41.900x001","C49.100x001","C49.100x002","C49.101","C49.102","C49.200x001","C49.200x002","C49.200x005","C49.201","C49.301","C49.400","C49.400x003","C49.501","C49.504","C49.600","C49.601","C49.800","C79.500x001","C79.500x006","C79.500x009","C79.500x010","C79.500x011","C79.500x012","C79.500x013","C79.500x021","C79.500x030","C79.500x031","C79.500x032","C79.501","C79.509","D36.105","D48.000x001","D48.001","D48.002","D48.003","D48.004","D48.005","D48.006","D48.013","D48.016","D48.017","D48.019","D48.020","D48.021","D48.100x007","D48.100x020","D48.103","D48.107","D48.110","D48.130","D48.134","D48.903+M90.7*","M80.000","M80.200","M80.300","M80.400","M80.800","M80.801","M80.900","M84.301"]
  adrg_zd1=[]
  adrg_ss=[]
  adrg_ss1=[]
  adrg_ss2=[]
  dept_list=[]
  if True and record.zdList[0] in adrg_zd:
    message('符合IU3入组条件，匹配规则：主诊断匹配')
    
    if MDCI_DRG.IU31_group(record):
      return 'IU31'

    if MDCI_DRG.IU35_group(record):
      return 'IU35'

    return 'IU3'
  else:
    return ''

